package crons

import (
	"webstack/model"
	"webstack/util"
)

func FetchTitle() {
	println("start fetch title")
	webs, err := model.GetIncompleteWeb()
	if err != nil {
		return
	}
	for _, web := range webs {
		data, err := util.UrlCrawler(web.URI)
		if err != nil {
			continue
		}
		web.Img = data.Image
		web.Description = data.Desc
		web.Update()
	}
}
